package day_240416;

public class SumTest {
    public static int add(int[] an) {
        int sum = 0;
        for (int i = 0; i < an.length; i++) {
            sum = sum + an[i];
        }
        return sum;
    }


    public static void main(String[] args) {
        int[] arr = new int[]{1, 2, 3, 4, 5};
        System.out.println(add(arr));
    }
}
